home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / June 96 / Re DoIdle.8 < prev    next >
Encoding:
Internet Message Format  |  1996-12-03  |  2.0 KB  |  [TEXT/ttxt]

  1. Subject:     Re: DoIdle
  2. Sent:        6/15/96 12:29 PM
  3. Received:    6/17/96 8:22 AM
  4. From:        Arni McKinley, motion@nbn.com
  5. Reply-To:    ODF Interest, ODF-Interest@CILabs.ORG
  6. To:          OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
  7.  
  8. Good idea.
  9.  
  10. Thanks for the info.
  11.  
  12. Arni
  13.  
  14. >>I have a LabelShape (a CBaseShape in ODFDraw or Sketch code) that requires
  15. >>an idler in order to blink the caret in the label. When it gets to be time
  16. >>to edit the label I make an FW_CEditView then do this:
  17. >>  in EditLabel()
  18. >>     fEditView->Enable(ev);
  19. >>        fEditView->BecomeTarget( ev );
  20. >>
  21. >>        if( fIdler == NULL )
  22. >>        {
  23. >>                fIdler = FW_NEW(FW_CIdler, (fEditView->GetFrame(ev), 5));
  24. >>                fIdler->RegisterIdle(ev);
  25. >>        }
  26. >>
  27. >>Later when the Label is deselected by the user I do this
  28. >>in SelectLabel( FW_Boolean state )
  29. >>    if( !state)
  30. >>    {
  31. >>       fEditView->Disable(ev);
  32. >>       if( fIdler )
  33. >>       {
  34. >>           fIdler->UnregisterIdle( ev );
  35. >>
  36. >>           delete fIdler;
  37. >>           fIdler = NULL;
  38. >>        }
  39. >>    }
  40. >>
  41. >>Sometime or other, you need to delete the idler. I do it when the Edit View
  42. >>is deleted
  43. >>                if( fIdler )
  44. >>                {
  45. >>                        fIdler->UnregisterIdle( ev );
  46. >>
  47. >>                        delete fIdler;
  48. >>                        fIdler = NULL;
  49. >>                }
  50. >>
  51. >>Hope this helps
  52. >>
  53. >>Arni
  54. >>
  55. >>
  56. >
  57. >You should not have to create and delete the idler everytime. Calling
  58. >Register and Unregister should be enough. Have you tried to create the
  59. >idler when the frame is created and call Register when the edit view
  60. >becomes the target and Unregister when it looses the target.
  61. >
  62. >........................................................................
  63. > Henri Lamiraux                                      lamiraux@apple.com
  64. > Apple Computer, Inc.                 OpenDoc(tm) Development Framework
  65. >........................................................................
  66.  
  67.